/**
 * 事件类型
 *
 * @param	Object	params	参数
 * @var		Object	{
 * 		"name"		String	事件名
 *		"target"	Object	目标对象
 *		"id"		String	事件名下的事件划分标识
 *	}
 */
var LBEvent = function (params) {

	if (!LBEvent._testName(params.name)) {
		
		throw	"LBEvent::__construct event name '" + params.name + "' has not registed";
	}

    this._eventName = params.name;
	this._target	= params.target;
	this._id		= params.id	? params.id + ''	: '';
}

LBEvent._nameList	= [];

LBEvent.registName	= function (eventName) {
	
	if (LBEvent._testName(eventName)) {
		
		throw	"LBEvent::_testName event name has registed";
	}

	LBEvent._nameList.push(eventName);
}

LBEvent._testName	= function (eventName) {
	
	for (var offset = 0;offset < LBEvent._nameList.length;offset ++) {
		
		if (eventName == LBEvent._nameList[offset]) {
			
			return	true;
		}
	}
	
	return	false;
}

LBEvent.prototype.getID		= function () {

	return	this._id;
}


LBEvent.prototype.getName	= function () {
	
	return	this._eventName;
}
